#!/usr/bin/env perl

use utf8;
use strict;

print "Which directory ? (Default is you home directory.)";
chomp (my $dir = <STDIN>);

if($dir =~ /\A\s*\Z/){
    chdir or die "Can't chdir to your home directory:$!.";
}
else{
    chdir $dir or die "Can't chdir dir to '$dir':$!.";
}

opendir HAS_DOT, "." or die "Can not opendir $dir:$!";

foreach my $file (sort readdir HAS_DOT){
    next if $file =~ /\A\./;
    print "$file\n";
}

closedir HAS_DOT;
